import React from 'react'

import './style.scss'
import SearchInput from '../SearchInput'

class SearchHeader extends React.Component{
    constructor(props, context){
        super(props, context)
    }
    render() {
        return (
            <div className="search-header">
                <i className="iconfont icon-fanhui" onClick={this.clickHandle}></i>
                <SearchInput value={this.props.value} enterHandle={this.enterHandle.bind(this)}></SearchInput>
            </div>
        )
    }
    componentDidMount() {
        
    }
    clickHandle() {
        window.history.back()
    }
    enterHandle(value) {
        this.props.history.push('/search/all/' + encodeURIComponent(value))
    }
}

export default SearchHeader